package com.waijiaojun.tpo.service;

import com.waijiaojun.tpo.entity.Question;
import com.waijiaojun.tpo.entity.Vocabulary;
import com.waijiaojun.tpo.repository.QuestionDao;
import com.waijiaojun.tpo.repository.VocabularyDao;
import com.waijiaojun.tpo.vo.BootstrapTableDataResponse;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * Created by Peter on 2018/3/1.
 */
@Service
public class VocabularyService {
    @Autowired
    private VocabularyDao vocabularyDao;


    public List<Vocabulary> findByArticleId(Long articleId) {
        return vocabularyDao.findByScenarioId(articleId);
    }

    public void delete(Long id) {
        vocabularyDao.delete(id);
    }

    public void add(Vocabulary vocabulary) {
        vocabularyDao.insertSelective(vocabulary);
    }

    public void update(Vocabulary vocabulary) {
        vocabularyDao.update(vocabulary);
    }
}
